package com.qingneng.dao;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.qingneng.vo.ContractInfo;

public class ContractInfoDaoImpl extends SqlMapClientDaoSupport implements IContractInfoDao{

	public List queryContractInfo() {
		List list = getSqlMapClientTemplate().queryForList("qn_db_contractinfo.select_contractinfo_sql");
		return list;
	}

	public Integer queryTotalCount() {
		Integer total =  (Integer)getSqlMapClientTemplate().queryForObject("qn_db_contractinfo.select_contractinfo_count_sql");	
		return total;
	}

	public void insertContractInfo(ContractInfo bean) {
		 this.getSqlMapClientTemplate().insert("qn_db_contractinfo.insert_contractinfo_sql", bean);
	}
	
	public void deleteContractInfo(ContractInfo bean) {
		 this.getSqlMapClientTemplate().delete("qn_db_contractinfo.delete_contractinfo_sql", bean);
	}

	public void update(ContractInfo bean) {
		 this.getSqlMapClientTemplate().update("qn_db_contractinfo.update_contractinfo_sql", bean);
		
	}

	public List queryContractInfo(ContractInfo contractInfo) {
		List list = getSqlMapClientTemplate().queryForList("qn_db_contractinfo.select_contractinfo_sql",contractInfo);
		return list;
	}

	public Integer queryTotalCount(ContractInfo contractInfo) {
		Integer total =  (Integer)getSqlMapClientTemplate().queryForObject("qn_db_contractinfo.select_contractinfo_count_sql",contractInfo);	
		return total;
	}

	public List queryMainContractInfo(ContractInfo contractInfo) {
		List list = new ArrayList();
	
		list = getSqlMapClientTemplate().queryForList("qn_db_contractinfo.select_main_contractinfo_sql",contractInfo);
				
		return list;			
		//return getSqlMapClientTemplate().queryForList("qn_db_contractinfo.select_main_contractinfo_sql",contractInfo,);
	}

	public List getContractInfoByStatus(Map paramMap) {
		List list = getSqlMapClientTemplate().queryForList("qn_db_contractinfo.select_aduit_contractinfo_sql",paramMap);
		return list;
	}


}
